<?php use_helper('jQuery') ?> 
<?php slot('no_sidebar', '') ?>

<h1 class="near">Slides</h1>

<p class="near">
  <a href="<?php echo url_for('@slide_new?presentation='.$presentationToken) ?>"><img src="/images/icons/add.png" alt="" /> Add a new slide</a> - 
  <span class="large"><?php echo count($slides) ?> slides</span> - 
  <a href="<?php echo url_for('@presentation_edit?token='.$presentationToken) ?>"><img src="/images/icons/pencil.png" alt="" /> Edit presentation properties</a> - 
  <a href="<?php echo url_for('@presentation_latex?token='.$presentationToken) ?>"><img src="/images/icons/script.png" alt="" /> LaTeX</a> - 
  <a href="<?php echo url_for('@presentation_download?token='.$presentationToken) ?>"><img src="/images/icons/report.png" alt="" /> Download</a>
</p>

<div id="feedback"></div>

<ul id="slides" class="span-24">
  <?php foreach ($slides as $i => $slide): ?>
    <li class="slide sortable" id="slide_<?php echo $slide['token'] ?>">
      <a href="<?php echo url_for('@slide_edit?token='.$slide['token']) ?>" title="Edit <?php echo $slide ?>">
        <?php if ($slide->getThumbnail()): ?>
          <img src="<?php echo sfConfig::get('app_thumbnails_web') .$slide->getThumbnail() ?>" alt="<?php echo $slide ?>" />
        <?php else : ?>
          <?php echo $slide ?>
        <?php endif; ?>
      </a>
    </li>
  <?php endforeach ?>
</ul>

<?php
  echo jq_sortable_element('#slides', array(
    'url'    => '@slide_order?token='. $presentationToken,
  ));
?>